<template>
  <div>
    <mt-swipe :show-indicators="false">
      <mt-swipe-item v-for="item in Swipeimgs" :key="item.img">
        <img :src="item.img" alt="">
      </mt-swipe-item>
    </mt-swipe>

    <!-- 九宫格 -->
    <ul class="mui-table-view mui-grid-view mui-grid-9">
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4"><router-link to="/home/newslist">
        <img src="../../images/menu1(1).png" alt="">
        <div class="mui-media-body">新闻资讯</div></router-link></li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4"><router-link to="/home/photolist">
        <img src="../../images/menu2.png" alt="">
        <div class="mui-media-body">图片资讯</div></router-link></li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4"><router-link to="/home/goodslist">
        <img src="../../images/menu3.png" alt="">
        <div class="mui-media-body">商品详情</div></router-link></li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4"><a href="#">
        <img src="../../images/menu4.png" alt="">
        <div class="mui-media-body">location</div></a></li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4"><a href="#">
        <img src="../../images/menu5.png" alt="">
        <div class="mui-media-body">Search</div></a></li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4"><a href="#">
        <img src="../../images/menu6.png" alt="">
        <div class="mui-media-body">Phone</div></a></li>
    </ul> 
  </div>
</template>

<script>
import { Toast } from "mint-ui";
export default {
  data() {
    return {
      Swipeimgs: []
    };
  },
  created() {
    this.getSwipeimgs();
  },
  methods: {
    getSwipeimgs() {
      this.$http.get("api/getlunbo").then(result => {
        if (result.body.status === 0) {
          this.Swipeimgs = result.body.message;
          Toast("success");
        } else {
          Toast("加载图片失败");
        }
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.mint-swipe {
  width: 100%;
  height: 200px;
}
.mint-swipe-item {
  &:nth-of-type(1) {
    background-color: red;
  }
  &:nth-of-type(2) {
    background-color: rgb(255, 238, 0);
  }
  &:nth-of-type(3) {
    background-color: rgb(0, 26, 255);
  }
  img {
    width: 100%;
    height: 100%;
  }
}
.mui-grid-view {
  background-color: #fff;
  img {
    width: 60px;
  }
}
.mui-grid-view .mui-table-view-cell {
  border: 0;
  div {
    font-size: 13px;
  }
}
</style>
